using System;
using System.IO;
using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Imaging;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using WebChart.Design;
using System.Configuration;
using System.Globalization;
using System.Diagnostics;
using System.Security;
using System.Threading;

namespace WebChart
{
	[ParseChildren(true), ToolboxBitmap(typeof(ChartControl), "WebChart.bmp"), DefaultProperty("Charts"), Designer(typeof(WebChartDesigner)), ToolboxData("<{0}:ChartControl BorderStyle=\"Outset\" BorderWidth=\"5px\" runat=\"server\"></{0}:ChartControl>")]
	public class ChartControl : WebControl
	{
		// Fields
		private static string _physicalPath;
		private static string _virtualPath;
		private static int autoCleanUpInterval = 30;
		private ChartInterior background;
		private ChartLine border;
		private ChartCollection charts;
		private ChartEngine engine;
		private string filename;
		private static DateTime lastCleanUpTime = DateTime.Now;
		private ChartLegend legend;
		private ChartInterior plotBackground;
		private ChartText title;
		private ChartText xaxisFont;
		private ChartText xtitle;
		private ChartText yaxisFont;
		private ChartText ytitle;

		// Methods
		static ChartControl()
		{
			string s = ConfigurationSettings.AppSettings["AutoCleanUpInterval"];
			if ((s != null) && (s.Length > 0))
			{
				try
				{
					try
					{
						autoCleanUpInterval = int.Parse(s, CultureInfo.InvariantCulture);
					}
					catch (Exception exception)
					{
						throw new ApplicationException("Ignoring AutoCleanUpInterval in config", exception);
					}
				}
				catch (ApplicationException)
				{
					autoCleanUpInterval = 30;
				}
			}
			else
			{
				autoCleanUpInterval = 30;
			}
			lastCleanUpTime = DateTime.MinValue;
		}

		public ChartControl() : base(HtmlTextWriterTag.Img)
		{
			this.filename = string.Empty;
			try
			{
				this.engine = new ChartEngine();
				this.border = new ChartLine(Color.Black);
				this.title = new ChartText();
				this.xtitle = new ChartText();
				this.ytitle = new ChartText();
				this.charts = new ChartCollection(this.engine);
				this.background = new ChartInterior(Color.LightSteelBlue);
				this.plotBackground = new ChartInterior(Color.White);
				this.legend = new ChartLegend();
				StringFormat format = new StringFormat();
				format.Alignment = StringAlignment.Far;
				format.FormatFlags = StringFormatFlags.LineLimit;
				this.yaxisFont = new ChartText(format);
				this.xaxisFont = new ChartText();
			}
			catch (ApplicationException exception)
			{
				EventLog.WriteEntry("WebChart Control", exception.ToString());
			}
		}

		protected override void AddAttributesToRender(HtmlTextWriter writer)
		{
			base.AddAttributesToRender(writer);
			if (this.AlternateText.Length > 0)
			{
				writer.AddAttribute(HtmlTextWriterAttribute.Alt, this.AlternateText);
			}
			if ((base.Site != null) && base.Site.DesignMode)
			{
				PhysicalPath = AddDirSeparator(Path.GetTempPath());
				VirtualPath = PhysicalPath;
				bool flag = false;
				if ((this.Charts.Count == 0) && this.Visible)
				{
					this.CreateFakeChart();
					flag = true;
				}
				this.RedrawChart();
				if (flag)
				{
					this.Charts.Clear();
				}
			}
			if ((this.filename.Length > 0) && File.Exists(this.filename))
			{
				writer.AddAttribute(HtmlTextWriterAttribute.Src, VirtualPath + this.ImageID + "." + this.ChartFormat.ToString(CultureInfo.InvariantCulture));
			}
			else
			{
				writer.AddAttribute(HtmlTextWriterAttribute.Src, this.DefaultImageUrl);
			}
		}

		private static string AddDirSeparator(string path)
		{
			string text = path;
			if (!text.EndsWith(@"\"))
			{
				text = text + @"\";
			}
			return text;
		}

		private static string AddPathSeparator(string path)
		{
			string text = path;
			if (!text.EndsWith("/"))
			{
				text = text + "/";
			}
			return text;
		}

		private void CreateFakeChart()
		{
			Chart chart = new ColumnChart();
			chart.Legend = "WebChart";
			this.Charts.Add(chart);
			this.InternalSet_ImageID("ChartDesigner" + this.UniqueID);
			if (this.Width.IsEmpty)
			{
				this.Width = 400;
			}
			if (this.Height.IsEmpty)
			{
				this.Height = 300;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public override void DataBind()
		{
			base.DataBind();
		}

		private ImageFormat GetImageFormat(ChartImageFormat format)
		{
			switch (format)
			{
				case ChartImageFormat.Png:
					return ImageFormat.Png;

				case ChartImageFormat.Bmp:
					return ImageFormat.Bmp;

				case ChartImageFormat.Jpg:
					return ImageFormat.Jpeg;

				case ChartImageFormat.Gif:
					return ImageFormat.Gif;

				case ChartImageFormat.Emf:
					return ImageFormat.Emf;

				case ChartImageFormat.Tif:
					return ImageFormat.Tiff;

				case ChartImageFormat.Wmf:
					return ImageFormat.Wmf;
			}
			return ImageFormat.Png;
		}

		private static string GetPhysicalPath()
		{
			string text = "";
			HttpContext current = HttpContext.Current;
			if (current != null)
			{
				text = current.Server.MapPath(current.Request.ApplicationPath);
				try
				{
					DirectoryInfo info = new DirectoryInfo(Path.Combine(text, "WebCharts"));
					if (!info.Exists)
					{
						info.Create();
					}
					return AddDirSeparator(info.FullName);
				}
				catch (SecurityException exception)
				{
					string name = string.Empty;
					if (((Thread.CurrentPrincipal != null) && (Thread.CurrentPrincipal.Identity != null)) && (Thread.CurrentPrincipal.Identity.Name != null))
					{
						name = Thread.CurrentPrincipal.Identity.Name;
					}
					string message = "The chart control wasn't able to create the WebCharts folder at: " + text + " please check for permissions of user: " + name + "\r\n" + exception.ToString();
					try
					{
						EventLog.WriteEntry("WebChart Control", message);
					}
					catch (SecurityException)
					{
					}
					throw new SecurityException(message, exception);
				}
				catch (UnauthorizedAccessException exception2)
				{
					string text4 = string.Empty;
					string text5 = "The chart control wasn't able to create the TempCharts folder at: " + text + " please create the folder and assign write permissions for user: " + text4 + "\r\n" + exception2.ToString();
					if (((Thread.CurrentPrincipal != null) && (Thread.CurrentPrincipal.Identity != null)) && (Thread.CurrentPrincipal.Identity.Name != null))
					{
						text4 = Thread.CurrentPrincipal.Identity.Name;
					}
					try
					{
						EventLog.WriteEntry("WebChart Control", text5);
					}
					catch (SecurityException)
					{
					}
					throw new SecurityException(text5, exception2);
				}
			}
			return text;
		}

		private static string GetVirtualPath()
		{
			string path = string.Empty;
			if (HttpContext.Current != null)
			{
				path = HttpContext.Current.Request.ApplicationPath;
			}
			return (AddPathSeparator(path) + "WebCharts/");
		}

		private void InitializeDefaultValues()
		{
			if (this.Width.IsEmpty)
			{
				this.Width = 400;
			}
			if (this.Height.IsEmpty)
			{
				this.Height = 300;
			}
		}

		private void InternalSet_ImageID(string val)
		{
			this.ViewState["ImageID"] = val;
		}

		public static void PerformCleanUp()
		{
			try
			{
				if (PhysicalPath.Length > 0)
				{
					DirectoryInfo info = new DirectoryInfo(PhysicalPath);
					foreach (FileInfo info2 in info.GetFiles())
					{
						try
						{
							string str = info2.Extension.ToUpper(CultureInfo.InvariantCulture);
							if (str != null)
							{
								str = string.IsInterned(str);
								if (((((str == ".PNG") || (str == ".JPG")) || ((str == ".GIF") || (str == ".BMP"))) || (((str == ".WMF") || (str == ".EMF")) || (str == ".TIF"))) && (info2.CreationTime.AddMinutes((double) autoCleanUpInterval) <= lastCleanUpTime))
								{
									info2.Delete();
								}
							}
						}
						catch (UnauthorizedAccessException)
						{
						}
						catch (IOException)
						{
						}
						catch (Exception)
						{
						}
					}
				}
				lastCleanUpTime = DateTime.Now;
			}
			catch (Exception)
			{
			}
		}

		public void RedrawChart()
		{
			ImageFormat imageFormat = this.GetImageFormat(this.ChartFormat);
			try
			{
				try
				{
					if ((autoCleanUpInterval > 0) && (lastCleanUpTime.AddMinutes((double) autoCleanUpInterval) < DateTime.Now))
					{
						PerformCleanUp();
					}
					this.InitializeDefaultValues();
					this.engine.Size = new Size((int) this.Width.Value, (int) this.Height.Value);
					this.engine.Title = this.title;
					this.engine.XTitle = this.xtitle;
					this.engine.YTitle = this.ytitle;
					this.engine.ShowTitlesOnBackground = this.ShowTitlesOnBackground;
					this.engine.HasChartLegend = this.HasChartLegend;
					this.engine.ChartPadding = this.ChartPadding;
					this.engine.Legend = this.Legend;
					this.engine.Padding = this.Padding;
					this.engine.TopPadding = this.TopPadding;
					this.engine.LeftChartPadding = this.LeftChartPadding;
					this.engine.RightChartPadding = this.RightChartPadding;
					this.engine.TopChartPadding = this.TopChartPadding;
					this.engine.BottomChartPadding = this.BottomChartPadding;
					this.engine.ShowXValues = this.ShowXValues;
					this.engine.ShowYValues = this.ShowYValues;
					this.engine.RenderHorizontally = this.RenderHorizontally;
					this.engine.YValuesInterval = this.YValuesInterval;
					this.engine.YValuesFormat = this.YValuesFormat;
					this.engine.XValuesInterval = this.XValuesInterval;
					this.engine.XTicksInterval = this.XTicksInterval;
					this.engine.YCustomStart = this.YCustomStart;
					this.engine.YCustomEnd = this.YCustomEnd;
					this.engine.Border = this.Border;
					this.engine.Background = this.Background;
					this.engine.PlotBackground = this.PlotBackground;
					this.engine.Title = this.ChartTitle;
					this.engine.Legend = this.Legend;
					this.engine.Charts = this.Charts;
					this.engine.XAxisFont = this.XAxisFont;
					this.engine.YAxisFont = this.YAxisFont;
					this.engine.GridLines = this.GridLines;
					this.filename = this.FileName;
					if ((this.Page != null) && this.Page.IsPostBack)
					{
						HttpBrowserCapabilities browser = this.Context.Request.Browser;
						if (this.Page.SmartNavigation || ((browser.MajorVersion >= 6) && (browser.Browser.IndexOf("IE") >= 0)))
						{
							try
							{
								if (File.Exists(this.filename))
								{
									File.Delete(this.filename);
								}
							}
							catch (IOException)
							{
							}
							this.InternalSet_ImageID(Guid.NewGuid().ToString());
							this.filename = this.FileName;
						}
					}
					try
					{
						this.engine.SaveToFile(this.filename, imageFormat);
					}
					catch (IOException)
					{
						this.InternalSet_ImageID(Guid.NewGuid().ToString());
						this.filename = this.FileName;
						this.engine.SaveToFile(this.filename, imageFormat);
					}
				}
				catch (Exception exception)
				{
					throw new ApplicationException("Error while rendering the chart.", exception);
				}
			}
			catch (ApplicationException exception2)
			{
				if ((this.Context != null) && (this.Context.Trace != null))
				{
					this.Context.Trace.Warn("Exception", exception2.ToString());
					this.Context.Trace.Warn("StackTrace", exception2.StackTrace);
					this.Context.Trace.Warn("FileName", this.filename);
				}
				try
				{
					this.engine.GenerateErrorBitmap(exception2.ToString()).Save(this.filename, imageFormat);
				}
				catch (Exception)
				{
					this.AlternateText = exception2.ToString() + "\r\n" + exception2.StackTrace;
				}
			}
		}

		// Properties
		[DefaultValue(""), Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced), Description("Sets or returns the alternate text to display when an image is not available for the device. The default value is an empty string.")]
		public string AlternateText
		{
			get
			{
				object obj2 = this.ViewState["AlternateText"];
				if (obj2 is string)
				{
					return (string) obj2;
				}
				return "";
			}
			set
			{
				this.ViewState["AlternateText"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
		public static int AutoCleanUpInterval
		{
			get
			{
				return autoCleanUpInterval;
			}
			set
			{
				autoCleanUpInterval = value;
			}
		}

		[Browsable(false)]
		public override Color BackColor
		{
			get
			{
				return base.BackColor;
			}
			set
			{
				base.BackColor = value;
			}
		}

		[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), Bindable(true), DefaultValue((string) null), NotifyParentProperty(true)]
		public ChartInterior Background
		{
			get
			{
				return this.background;
			}
			set
			{
				this.background = value;
			}
		}

		[Category("Appearance"), NotifyParentProperty(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), DefaultValue((string) null)]
		public ChartLine Border
		{
			get
			{
				return this.border;
			}
			set
			{
				this.border = value;
			}
		}

		[Category("Appearance"), Browsable(true), Description("Sets or returns the additional padding between the chart area and the bottom of the chart"), DefaultValue(typeof(short), "0")]
		public short BottomChartPadding
		{
			get
			{
				object obj2 = this.ViewState["BottomChartPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 0;
			}
			set
			{
				this.ViewState["BottomChartPadding"] = value;
			}
		}

		[Description("Sets or returns the image format to use"), Browsable(true), Category("Appearance"), DefaultValue(0)]
		public ChartImageFormat ChartFormat
		{
			get
			{
				object obj2 = this.ViewState["ChartFormat"];
				if (obj2 != null)
				{
					return (ChartImageFormat) obj2;
				}
				return ChartImageFormat.Png;
			}
			set
			{
				this.ViewState["ChartFormat"] = value;
			}
		}

		[DefaultValue(typeof(short), "20"), Description("Sets or returns the padding between the chart area and the chart"), Browsable(true), Category("Appearance")]
		public short ChartPadding
		{
			get
			{
				object obj2 = this.ViewState["ChartPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 20;
			}
			set
			{
				this.ViewState.SetItemDirty("ChartPadding", true);
				this.ViewState["ChartPadding"] = value;
			}
		}

		[Browsable(true), Category("Appearance"), DefaultValue((string) null), PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true)]
		public ChartCollection Charts
		{
			get
			{
				return this.charts;
			}
		}

		[NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance"), DefaultValue((string) null)]
		public ChartText ChartTitle
		{
			get
			{
				return this.title;
			}
			set
			{
				this.title = value;
			}
		}

		[Editor(typeof(ImageUrlEditor), typeof(UITypeEditor)), Category("Appearance"), Browsable(true), Description("Sets or returns the default image to display when an image is not available for the device. The default value is an empty string."), DefaultValue("")]
		public string DefaultImageUrl
		{
			get
			{
				object obj2 = this.ViewState["DefaultImageUrl"];
				if (obj2 is string)
				{
					return (string) obj2;
				}
				return string.Empty;
			}
			set
			{
				this.ViewState["DefaultImageUrl"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
		public string FileName
		{
			get
			{
				if (PhysicalPath.Length <= 0)
				{
					throw new SecurityException("The PhysicalPath property has not been set");
				}
				return (PhysicalPath + this.ImageID + "." + Enum.GetName(typeof(ChartImageFormat), this.ChartFormat));
			}
		}

		[Browsable(false)]
		public override FontInfo Font
		{
			get
			{
				return base.Font;
			}
		}

		[Browsable(false)]
		public override Color ForeColor
		{
			get
			{
				return base.ForeColor;
			}
			set
			{
				base.ForeColor = value;
			}
		}

		[Category("Appearance"), Browsable(true), DefaultValue(1), Description("Gets or sets a value that specifies the grid line style to display in the Chart")]
		public GridLines GridLines
		{
			get
			{
				object obj2 = this.ViewState["GridLines"];
				if (obj2 != null)
				{
					return (GridLines) obj2;
				}
				return GridLines.Horizontal;
			}
			set
			{
				this.ViewState["GridLines"] = value;
			}
		}

		[Description("Sets or returns if the legends box are shown"), DefaultValue(true), Browsable(true), Category("Appearance")]
		public bool HasChartLegend
		{
			get
			{
				object obj2 = this.ViewState["HasChartLegend"];
				if (obj2 != null)
				{
					return (bool) obj2;
				}
				return true;
			}
			set
			{
				this.ViewState["HasChartLegend"] = value;
			}
		}

		[DefaultValue(typeof(Unit), "300px")]
		public override Unit Height
		{
			get
			{
				return base.Height;
			}
			set
			{
				base.Height = value;
			}
		}

		[Browsable(false)]
		public string ImageID
		{
			get
			{
				object obj2 = this.ViewState["ImageID"];
				if (obj2 == null)
				{
					string val = Guid.NewGuid().ToString();
					this.InternalSet_ImageID(val);
					return val;
				}
				return (string) obj2;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
		public static DateTime LastCleanupTime
		{
			get
			{
				return lastCleanUpTime;
			}
		}

		[Browsable(true), DefaultValue(typeof(short), "10"), Description("Sets or returns the additional padding between the left border and the chart"), Category("Appearance")]
		public short LeftChartPadding
		{
			get
			{
				object obj2 = this.ViewState["LeftChartPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 10;
			}
			set
			{
				this.ViewState["LeftChartPadding"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), Category("Appearance"), Description("Specifies the legend for the chart"), NotifyParentProperty(true)]
		public ChartLegend Legend
		{
			get
			{
				return this.legend;
			}
		}

		[Description("Sets or returns the padding between the borders and the chart area"), Category("Appearance"), DefaultValue(typeof(short), "10"), Browsable(true)]
		public short Padding
		{
			get
			{
				object obj2 = this.ViewState["Padding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 10;
			}
			set
			{
				this.ViewState["Padding"] = value;
			}
		}

		[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public static string PhysicalPath
		{
			get
			{
				if ((_physicalPath == null) || (_physicalPath.Length == 0))
				{
					_physicalPath = GetPhysicalPath();
				}
				return _physicalPath;
			}
			set
			{
				_physicalPath = value;
			}
		}

		[PersistenceMode(PersistenceMode.InnerProperty), DefaultValue((string) null), Category("Appearance"), NotifyParentProperty(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartInterior PlotBackground
		{
			get
			{
				return this.plotBackground;
			}
			set
			{
				this.plotBackground = value;
			}
		}

		[Category("Appearance"), Description("Sets or returns if the chart will be rendered horizontally, By Default it will be false, so it will render vertically"), DefaultValue(false), Browsable(true)]
		public bool RenderHorizontally
		{
			get
			{
				object obj2 = this.ViewState["RenderHorizontally"];
				if (obj2 != null)
				{
					return (bool) obj2;
				}
				return false;
			}
			set
			{
				this.ViewState["RenderHorizontally"] = value;
			}
		}

		[Browsable(true), Category("Appearance"), Description("Sets or returns the additional padding between the chart area and the right of the chart"), DefaultValue(typeof(short), "0")]
		public short RightChartPadding
		{
			get
			{
				object obj2 = this.ViewState["RightChartPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 0;
			}
			set
			{
				this.ViewState["RightChartPadding"] = value;
			}
		}

		[DefaultValue(true), Browsable(true), Category("Appearance"), Description("Sets or returns if the values in the X Axis are shown")]
		public bool ShowTitlesOnBackground
		{
			get
			{
				object obj2 = this.ViewState["ShowTitlesOnBackground"];
				if (obj2 != null)
				{
					return (bool) obj2;
				}
				return true;
			}
			set
			{
				this.ViewState["ShowTitlesOnBackground"] = value;
			}
		}

		[Browsable(true), Description("Sets or returns if the values in the X Axis are shown"), Category("Appearance"), DefaultValue(true)]
		public bool ShowXValues
		{
			get
			{
				object obj2 = this.ViewState["ShowXValues"];
				if (obj2 != null)
				{
					return (bool) obj2;
				}
				return true;
			}
			set
			{
				this.ViewState["ShowXValues"] = value;
			}
		}

		[Description("Sets or returns if the values in the Y Axis are shown"), Browsable(true), Category("Appearance"), DefaultValue(true)]
		public bool ShowYValues
		{
			get
			{
				object obj2 = this.ViewState["ShowYValues"];
				if (obj2 != null)
				{
					return (bool) obj2;
				}
				return true;
			}
			set
			{
				this.ViewState["ShowYValues"] = value;
			}
		}

		[Category("Appearance"), DefaultValue(typeof(short), "0"), Description("Sets or returns the additional padding between the chart area and the top of the chart"), Browsable(true)]
		public short TopChartPadding
		{
			get
			{
				object obj2 = this.ViewState["TopChartPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 0;
			}
			set
			{
				this.ViewState["TopChartPadding"] = value;
			}
		}

		[Description("Sets or returns the padding between the top border and the chart"), DefaultValue(typeof(short), "15"), Browsable(true), Category("Appearance")]
		public short TopPadding
		{
			get
			{
				object obj2 = this.ViewState["TopPadding"];
				if (obj2 != null)
				{
					return (short) obj2;
				}
				return 15;
			}
			set
			{
				this.ViewState["TopPadding"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
		public static string VirtualPath
		{
			get
			{
				if ((_virtualPath == null) || (_virtualPath.Length == 0))
				{
					_virtualPath = GetVirtualPath();
				}
				return _virtualPath;
			}
			set
			{
				_virtualPath = value;
			}
		}

		[DefaultValue(typeof(Unit), "400px")]
		public override Unit Width
		{
			get
			{
				return base.Width;
			}
			set
			{
				base.Width = value;
			}
		}

		[Category("Appearance"), PersistenceMode(PersistenceMode.InnerProperty), Browsable(true), DefaultValue((string) null), NotifyParentProperty(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartText XAxisFont
		{
			get
			{
				return this.xaxisFont;
			}
		}

		[Description("Sets or returns the interval of the ticks to display in the X Axis. (Default is 0 which means every tick will have its legend shown in X axis)"), Category("Appearance"), Browsable(true), DefaultValue(0)]
		public int XTicksInterval
		{
			get
			{
				object obj2 = this.ViewState["XTicksInterval"];
				if (obj2 != null)
				{
					return (int) obj2;
				}
				return 0;
			}
			set
			{
				this.ViewState["XTicksInterval"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), DefaultValue((string) null), Category("Appearance"), PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true)]
		public ChartText XTitle
		{
			get
			{
				return this.xtitle;
			}
			set
			{
				this.xtitle = value;
			}
		}

		[Browsable(true), DefaultValue(0), Category("Appearance"), Description("Sets or returns the interval of the points to display in the X Axis. (Default is 0 which means every point will have its legend shown in X axis)")]
		public int XValuesInterval
		{
			get
			{
				object obj2 = this.ViewState["XValuesInterval"];
				if (obj2 != null)
				{
					return (int) obj2;
				}
				return 0;
			}
			set
			{
				this.ViewState["XValuesInterval"] = value;
			}
		}

		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty), Category("Appearance"), Browsable(true), DefaultValue((string) null)]
		public ChartText YAxisFont
		{
			get
			{
				return this.yaxisFont;
			}
		}

		[Browsable(true), Description("Sets or returns the custom end point of the chart. (Default is 0 which means calculated by WebControl)"), Category("Appearance"), DefaultValue(0)]
		public float YCustomEnd
		{
			get
			{
				object obj2 = this.ViewState["YCustomEnd"];
				if (obj2 != null)
				{
					return (float) obj2;
				}
				return 0f;
			}
			set
			{
				this.ViewState["YCustomEnd"] = value;
			}
		}

		[Browsable(true), Category("Appearance"), DefaultValue(0), Description("Sets or returns the custom start point of the chart. (Default is 0 which means calculated by WebControl)")]
		public float YCustomStart
		{
			get
			{
				object obj2 = this.ViewState["YCustomStart"];
				if (obj2 != null)
				{
					return (float) obj2;
				}
				return 0f;
			}
			set
			{
				this.ViewState["YCustomStart"] = value;
			}
		}

		[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true), DefaultValue((string) null)]
		public ChartText YTitle
		{
			get
			{
				return this.ytitle;
			}
			set
			{
				this.ytitle = value;
			}
		}

		[Category("Appearance"), Browsable(true), Description("Sets or returns the format to use when drawing the Values in the Y Axis"), DefaultValue((string) null)]
		public string YValuesFormat
		{
			get
			{
				object obj2 = this.ViewState["YValuesFormat"];
				if (obj2 != null)
				{
					return (string) obj2;
				}
				return null;
			}
			set
			{
				this.ViewState["YValuesFormat"] = value;
			}
		}

		[Description("Sets or returns the interval of the points to display in the Y Axis. (Default is 0 which means calculated by WebControl)"), Browsable(true), Category("Appearance"), DefaultValue(0)]
		public float YValuesInterval
		{
			get
			{
				object obj2 = this.ViewState["YValuesInterval"];
				if (obj2 != null)
				{
					return (float) obj2;
				}
				return 0f;
			}
			set
			{
				this.ViewState["YValuesInterval"] = value;
			}
		}
	}
}
